package org.jeecg.jt808.operate;


import org.jeecg.jt808.JTT808Encoder;
import org.jeecg.jt808.JTT808Message;
import org.jeecg.jt808.Jt808Control.Jt808CentralControlConfig;
import org.jeecg.jt808.modbus.ModbusParams;
import org.jeecg.jt808.processor.JT808MessageGenerator;
import org.jeecg.jt808.processor.MessageType;
import org.springframework.stereotype.Component;

import static org.jeecg.jt808.util.JT808Util.bytesToHexString;



public class LocationQueryMessageGenerator implements JT808MessageGenerator {

    @Override
    public String generateMessage(JTT808Message message) {
        message.id = 0x8201; // 位置信息查询消息 ID
        message.packetCount = 0;
        message.packetIndex = 0;
        message.body = new byte[0]; // 消息体为空
        return bytesToHexString(JTT808Encoder.encode(message));
    }

    @Override
    public String generateMessage(JTT808Message message, Jt808CentralControlConfig config) {
        return "";
    }

    @Override
    public String generateMessage(JTT808Message message, ModbusParams params) {
        return "";
    }

    @Override
    public String getType() {
        return MessageType.QUERY_LOCATION.name();
    }
}